﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using xiaodingmarket_Domain_core.Models;

namespace xiaodingmarket_Domain.Models
{
    public class Role : AggregateRoot
    {
        public Role()
        {

        }
        public Role(string name, string remark, DateTime logTime, DateTime modifyTime, Guid createUserId, Guid modifyUserId, bool isDelete, List<UserRoles> userroles, List<ModuleRoles> moduleoles)
        {
            Name = name;
            this.remark = remark;
            LogTime = logTime;
            ModifyTime = modifyTime;
            CreateUserId = createUserId;
            ModifyUserId = modifyUserId;
            IsDelete = isDelete;
            this.userroles = userroles;
            this.moduleoles = moduleoles;
        }

        /// <summary>
        ///角色名
        /// </summary>
        [Column(TypeName = "varchar(100)")]
        public String Name { get; set; }
        /// <summary>
        ///备注
        /// </summary>
        [Column(TypeName = "varchar(200)")]
        public String remark { get; set; }
        /// <summary>
        /// 生成时间
        /// </summary>
        public DateTime LogTime { get; set; }
        /// <summary>
        /// 最后一次修改时间
        /// </summary>
        public DateTime ModifyTime { get; set; }
        /// <summary>
        /// 创建者id
        /// </summary>
        public Guid CreateUserId { get; set; }
        /// <summary>
        /// 修改者id
        /// </summary>
        public Guid ModifyUserId { get; set; }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDelete { get; set; }

        public List<UserRoles> userroles { get; set; }
        public List<ModuleRoles> moduleoles { get; set; }
    }
}
